package com.alks.function.controller.produce;

import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.Idempotent;
import com.alks.common.aop.WebLogger;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.request.chengKong.LotNoRequest;
import com.alks.function.data.request.produce.*;
import com.alks.function.service.produce.PcStitchBarcodeHeadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@ApiRestController("/produce")
@Api(tags ={ "生产部-生产作业-鞋面条码标签打印","生产部-生产作业-指令领料作业","生产部-生产作业-预加领料作业","生产部-生产作业-补单领料作业","仓储部-仓储工厂查询-鞋面条码标签查询","生产部-生产作业-多购领料作业"})
@Slf4j
public class PcStitchBarcodeHeadController {

    @Resource
    private PcStitchBarcodeHeadService pcStitchBarcodeHeadService;

    @WebLogger
    @PostMapping("/PcStitchBarcodeHeadList")
    @ApiOperation(value = "鞋面条码信息",tags = "生产部-生产作业-鞋面条码标签打印")
    public ResponseInfo PcStitchBarcodeHeadList(@RequestBody PcStitchBarcodeHeadListRequest request){
        return pcStitchBarcodeHeadService.PcStitchBarcodeHeadList(request);
    }

    @WebLogger
    @PostMapping("/getPcStitchBarcodeHeadList")
    @ApiOperation(value = "鞋面条码信息查询",tags = "仓储部-仓储工厂查询-鞋面条码标签查询")
    public ResponseInfo getPcStitchBarcodeHeadList(@RequestBody PcStitchBarcodeHeadListRequest request){
        return pcStitchBarcodeHeadService.PcStitchBarcodeHeadList(request);
    }

    @WebLogger
    @PostMapping("/GenerateShoeUpperLabels")
    @ApiOperation(value = "生成鞋面标签",tags = "生产部-生产作业-鞋面条码标签打印")
    public ResponseInfo GenerateShoeUpperLabels(@RequestBody PcStitchBarcodeHeadAddRequest request){
        return pcStitchBarcodeHeadService.GenerateShoeUpperLabels(request);
    }

    @WebLogger
    @PostMapping("/regenerate")
    @ApiOperation(value = "重新生成标签",tags = "生产部-生产作业-鞋面条码标签打印")
    public ResponseInfo regenerate(@RequestBody List<PcStitchBarcodeHeadAddRequest> lists, @RequestParam String lotNo){
        return pcStitchBarcodeHeadService.regenerate(lists,lotNo);
    }

    @WebLogger
    @PostMapping("/checkLabel")
    @ApiOperation(value = "拆分标签-检查",tags = "生产部-生产作业-鞋面条码标签打印")
    public ResponseInfo checkLabel(@RequestParam String barcode){
        return pcStitchBarcodeHeadService.checkLabel(barcode);
    }

    @WebLogger
    @PostMapping("/splitLabel")
    @ApiOperation(value = "拆分标签-拆分鞋面标签",tags = "生产部-生产作业-鞋面条码标签打印")
    public ResponseInfo splitLabel(@RequestParam List<Integer> caseQtys,@RequestParam String barcode){
        return pcStitchBarcodeHeadService.splitLabel(caseQtys,barcode);
    }

    @WebLogger
    @PostMapping("/regenerateSizeNoList")
    @ApiOperation(value = "重新生成标签-号码查询",tags = "生产部-生产作业-鞋面条码标签打印")
    public ResponseInfo regenerateSizeNoList(@RequestParam String lotNo){
        return pcStitchBarcodeHeadService.regenerateSizeNoList(lotNo);
    }

    @WebLogger
    @PostMapping("/reprint")
    @ApiOperation(value = "重打标签",tags = "生产部-生产作业-鞋面条码标签打印")
    public ResponseInfo reprint(@RequestParam String barcode){
        return pcStitchBarcodeHeadService.reprint(barcode);
    }

    @WebLogger
    @PostMapping("/delete")
    @ApiOperation(value = "删除标签",tags = "生产部-生产作业-鞋面条码标签打印")
    public ResponseInfo delete(@RequestParam String lotNo) {
        return pcStitchBarcodeHeadService.delete(lotNo);
    }

    @WebLogger
    @PostMapping("/PrintSelectedLabels")
    @ApiOperation(value = "打印所选标签",tags = "生产部-生产作业-鞋面条码标签打印")
    public ResponseInfo PrintSelectedLabels(@RequestBody PrintSelectedLabelsRequest request){
        return pcStitchBarcodeHeadService.PrintSelectedLabels(request);
    }

    @WebLogger
    @PostMapping("/PrintShoeUpperLabels")
    @ApiOperation(value = "打印鞋面标签",tags = "生产部-生产作业-鞋面条码标签打印")
    public ResponseInfo PrintShoeUpperLabels(@RequestBody PrintSelectedLabelsRequest request){
        return pcStitchBarcodeHeadService.PrintShoeUpperLabels(request);
    }

    @WebLogger
    @PostMapping("/DisplayNumber")
    @ApiOperation(value = "显示号码",tags = "生产部-生产作业-鞋面条码标签打印")
    public ResponseInfo DisplayNumber(@RequestBody LotNoRequest request){
        return pcStitchBarcodeHeadService.DisplayNumber(request);
    }

    @WebLogger
    @PostMapping("/QueryOfInstructionUsageDetails")
    @ApiOperation(value = "选择材料-指令用量明细查询",tags = "生产部-生产作业-指令领料作业")
    public ResponseInfo QueryOfInstructionUsageDetails(@RequestBody LotNoQueryRequest request){
        return pcStitchBarcodeHeadService.QueryOfInstructionUsageDetails(request);
    }

    @WebLogger
    @GetMapping("/QueryOfInstructionUsageDetails2/{choose}")
    @ApiOperation(value = "指令用量明细查询",tags = "生产部-生产作业-指令领料作业")
    public ResponseInfo QueryOfInstructionUsageDetails2(@PathVariable("choose")@ApiParam("0 指令领料,1预加领料,2补料领料") Integer choose){
        return pcStitchBarcodeHeadService.QueryOfInstructionUsageDetails2(choose);
    }

    @WebLogger
    @PostMapping("/MaterialRequisitionDetailsFile/{choose}")
    @ApiOperation(value = "领料明细档",tags = "生产部-生产作业-指令领料作业")
    public ResponseInfo MaterialRequisitionDetailsFile(@RequestBody PcDrawDetailRequest request,@PathVariable("choose")@ApiParam("0 指令领料,1预加领料,2补料领料") Integer choose){
        return pcStitchBarcodeHeadService.MaterialRequisitionDetailsFile(request,choose);
    }

    @WebLogger
    @PostMapping("/PendingBatchProcessing/{choose}")
    @ApiOperation(value = "待领批处理",tags = "生产部-生产作业-指令领料作业")
    @Idempotent
    public ResponseInfo PendingBatchProcessing(@RequestBody List<PcDrawTemp2Request> request, @PathVariable("choose")@ApiParam("0 指令领料,1预加领料,2补料领料") Integer choose){
        return pcStitchBarcodeHeadService.PendingBatchProcessing(request,choose);
    }

    @WebLogger
    @PostMapping("/BatchProcessingOfMaterialRequisition/{choose}")
    @ApiOperation(value = "领料批处理",tags = "生产部-生产作业-指令领料作业")
    @Idempotent
    public ResponseInfo BatchProcessingOfMaterialRequisition(@RequestBody List<PcDrawDetailAddRequest> request,@PathVariable("choose")@ApiParam("0 指令领料,1预加领料,2补料领料") Integer choose){
        return pcStitchBarcodeHeadService.BatchProcessingOfMaterialRequisition(request,choose);
    }

    @WebLogger
    @PutMapping("/PrintMaterialRequisitionForm")
    @ApiOperation(value = "打印领料单",tags = "生产部-生产作业-指令领料作业")
    public ResponseInfo PrintMaterialRequisitionForm(@RequestBody List<PcDrawDetailUpdateRequest> request){
        return pcStitchBarcodeHeadService.PrintMaterialRequisitionForm(request);
    }

    @WebLogger
    @PutMapping("/ModifyRemarks/{choose}")
    @ApiOperation(value = "指令用量查询-修改备注",tags = "生产部-生产作业-指令领料作业")
    public ResponseInfo ModifyRemarks(@RequestBody PcDrawDetailUpdateRequest request,@PathVariable("choose")@ApiParam("0 指令领料,1预加领料,2补料领料") Integer choose){
        return pcStitchBarcodeHeadService.ModifyRemarks(request,choose);
    }
    @WebLogger
    @PostMapping("/partNameList")
    @ApiOperation(value = "选择材料-部位用量明细查询",tags = "生产部-生产作业-指令领料作业")
    public ResponseInfo partNameList(@RequestBody PcDrawDetailUpdateRequest request){
        return pcStitchBarcodeHeadService.partNameList(request);
    }

    @WebLogger
    @PostMapping("/SelectPreAddedMaterials")
    @ApiOperation(value = "选择预加材料-指令用量明细查询",tags = "生产部-生产作业-预加领料作业")
    public ResponseInfo SelectPreAddedMaterials(@RequestBody LotNoQueryRequest request){
        return pcStitchBarcodeHeadService.SelectPreAddedMaterials(request);
    }

    @WebLogger
    @PostMapping("/SelectSupplementaryOrderMaterials")
    @ApiOperation(value = "选择材料-指令用量明细查询",tags = "生产部-生产作业-补单领料作业")
    public ResponseInfo SelectSupplementaryOrderMaterials(@RequestBody LotNoQueryRequest request){
        return pcStitchBarcodeHeadService.SelectSupplementaryOrderMaterials(request);
    }

    @WebLogger
    @PutMapping("/PrintDocuments")
    @ApiOperation(value = "打印单据",tags = "生产部-生产作业-补单领料作业")
    public ResponseInfo PrintDocuments(@RequestBody PcDrawDetailUpdateRequest request){
        return pcStitchBarcodeHeadService.PrintDocuments(request);
    }

    @WebLogger
    @PostMapping("/moreList")
    @ApiOperation(value = "查询",tags = "生产部-生产作业-多购领料作业")
    public ResponseInfo moreList(@RequestBody LotNoQueryRequest request){
        return pcStitchBarcodeHeadService.moreList(request);
    }

    @WebLogger
    @PostMapping("/moreCollar")
    @ApiOperation(value = "领料批处理",tags = "生产部-生产作业-多购领料作业")
    @Idempotent
    public ResponseInfo moreCollar(@RequestBody List<PcDrawDetailAddRequest> request){
        return pcStitchBarcodeHeadService.moreCollar(request);
    }

    @WebLogger
    @PostMapping("/moreCheck")
    @ApiOperation(value = "领料处理检查",tags = "生产部-生产作业-多购领料作业")
    @Idempotent
    public ResponseInfo moreCheck(@RequestBody PcDrawDetailAddRequest request){
        return pcStitchBarcodeHeadService.moreCheck(request);
    }

    @WebLogger
    @PostMapping("/moreList2")
    @ApiOperation(value = "领料明细档",tags = "生产部-生产作业-多购领料作业")
    public ResponseInfo moreList2(@RequestBody PcDrawDetailRequest request){
        return pcStitchBarcodeHeadService.moreList2(request);
    }
}
